public class TranslateWorld implements Action {

  float initX;
  float initY;
  Node world;

  public TranslateWorld(Node world) {
    this.world = world;
  }

  public void mouseDrag(float x, float y) {
    PVector o = this.world.getOrigin();
    o.add(new PVector(x-initX, y-initY));
    this.world.setOrigin(o);
    initX = x;
    initY = y;
  }

  public void mousePress(float x, float y) {
    this.initX = x;
    this.initY = y;
  }    
  void mouseClick(float x, float y) {
  }

  void mouseMove(float x, float y) {
  }
}

